<%--
 * action-2.jsp
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 --%>

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@ taglib prefix="acme" tagdir="/WEB-INF/tags"%>

<form:form action="event/administrator/edit.do" modelAttribute="event">

	<form:hidden path="id" />
	<form:hidden path="version" />
	
	<!-- estaban como hidden administrator , routes y referenceNumber -->

	<acme:textbox code="event.title" path="title" readonly="${readonly}" />
	<br />
	<acme:textbox code="event.fee" path="fee" readonly="${readonly}" />
	<br />
	<acme:textbox code="event.creationMoment" path="creationMoment"
		readonly="true" />
	<br />
	<acme:textbox code="event.start" path="startMoment"
		readonly="${readonly}" />
	<br />
	<acme:textbox code="event.finish" path="finishMoment"
		readonly="${readonly}" />
	<br />
	<acme:textbox code="event.description" path="description"
		readonly="${readonly}" />
	<br />
	<jstl:if test="${!isNew}">
	<acme:textbox code="event.rating" path="rating" readonly="true" />
	</jstl:if>

	<jstl:if test="${readonly}">
		<display:table pagesize="5" class="displaytag" keepStatus="true"
			name="participants" requestURI="${requestURI}" id="row">

			<!-- Attributes -->
			<spring:message code="event.participant.name" var="nameHeader" />
			<display:column property="name" title="${nameHeader}" sortable="true" />

			<spring:message code="event.participant.surname" var="surnameHeader" />
			<display:column property="surname" title="${surnameHeader}"
				sortable="true" />
		</display:table>
	</jstl:if>

	<jstl:if test="${!readonly}">
	<acme:submit name= "save" code= "event.save"/>
	<jstl:if test="${!isNew}">
	<acme:submit name= "delete" code= "event.delete"/>
	</jstl:if>
	</jstl:if>
	
	<acme:cancel url="/event/administrator/created.do" code="event.cancel"/>
</form:form>


